<template>

  <div style="padding-top: 40px">
    <!-- main -->
    <div class="main">
      <div class="main-container" style="margin-left: 0px">
        <div class="container">
          <div class="location clearfix">
            <router-link :to="{ name: 'indexList'}">首页</router-link>
            <a href="javascript:;">查看文件</a>
          </div>

          <div class="article-container">
            <div class="article-header">
              <div class="title">{{docData.title}}</div>
              <div class="tags">
                <div class="item">分类：{{docData.docType_dictText}}</div>
                <div class="item">来源：{{docData.docFrom}}</div>
                <div class="item">关键字：{{docData.keyWord}}</div>
                <br>
                <div class="item">资料简介：{{ docData.remarks}}</div>
              </div>
            </div>
            <div class="article-content clearfix">
              <div style=" overflow-x: hidden; overflow-y: scroll">
                <pdf-frame  :src="docData.viewUrl" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- main end -->
  </div>

</template>

<script>

import VideoShow from './components/VideoShow'
import { fetchDetail } from '@/api/document/document'
import PdfFrame from './components/PdfFrame'
import EmptyView from '@/components/EmptyView/index'


export default {
  components: {  EmptyView,  PdfFrame,  VideoShow },
  data() {
    return {
      docData: {},
    }
  },

  created() {
    // 文档ID
    const id = this.$route.params.docId
    this.fetchData(id)
  },
  methods: {

    fetchData(docId) {
      fetchDetail(docId).then(res => {
        this.docData = res.data
      })
    }
  }
}
</script>

